import request from '@/utils/request'

// 查询合同信息列表
export function listContract(query) {
  return request({
    url: '/customer/contract/list',
    method: 'get',
    params: query
  })
}

// 查询合同信息详细
export function getContract(id) {
  return request({
    url: '/customer/contract/' + id,
    method: 'get'
  })
}

// 基于客户Id查询合同详细
export function contractByCustomerId(customerId) {
  return request({
    url: '/customer/contract/byCustomerId/' + customerId,
    method: 'get',
  })
}

// 新增合同信息
export function addContract(data) {
  return request({
    url: '/customer/contract',
    method: 'post',
    data: data
  })
}

// 修改合同信息
export function updateContract(data) {
  return request({
    url: '/customer/contract',
    method: 'put',
    data: data
  })
}

// 删除合同信息
export function delContract(id) {
  return request({
    url: '/customer/contract/' + id,
    method: 'delete'
  })
}

//修改nullify_state状态为作废
export function updateNullifyStatus(data) {
  return request({
    url: '/customer/contract/nullifyStatus',
    method: 'put',
    data: data
  })
}

//修改affix_seal_state状态为盖章
export function updateAffixSealStatus(data) {
  return request({
    url: '/customer/contract/affixSealStatus',
    method: 'put',
    data: data
  })
}

//修改audit_state状态为审核通过
export function updateAuditPassStatus(data) {
  return request({
    url: '/customer/contract/auditPassStatus',
    method: 'put',
    data: data
  })
}

//修改audit_state状态为审核不通过
export function updateAuditOverStatus(data) {
  return request({
    url: '/customer/contract/auditOverStatus',
    method: 'put',
    data: data
  })
}

